//
//  LCShowImageController.swift
//  dj-learn-Swift
//
//  Created by jie sun on 2022/5/19.
//  Copyright © 2022 S.J. All rights reserved.
//

import UIKit

class LCShowImageController: UIViewController {
    var imgView = UIImageView()

    
    @objc func takePhoto() {
        
        let vc = LCCardCameraController()
        vc.modalPresentationStyle = .fullScreen
        vc.successTake = { image in
            self.imgView.image = image
        }
        self.present(vc, animated: true)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .camera, target: self, action: #selector(takePhoto))

        self.view.addSubview(self.imgView)
        self.imgView.snp.makeConstraints { make in
            make.edges.equalTo(self.view)
        }
        self.imgView.contentMode = .scaleAspectFit
    }
}
